<!DOCTYPE html>
<html lang=zh>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="1. 必要资源说明   插件地址 插件名称    github.com&#x2F;mdempsky&#x2F;gocode gocode   github.com&#x2F;uudashr&#x2F;gopkgs&#x2F;cmd&#x2F;gopkgs gopkgs   github.com&#x2F;ramya-rao-a&#x2F;go-outline go-outline   github.com&#x2F;acroca&#x2F;go-symbols go-symbols   gola">
<meta property="og:type" content="article">
<meta property="og:title" content="VScode下的Go插件配置">
<meta property="og:url" content="http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/index.html">
<meta property="og:site_name" content="传火之人">
<meta property="og:description" content="1. 必要资源说明   插件地址 插件名称    github.com&#x2F;mdempsky&#x2F;gocode gocode   github.com&#x2F;uudashr&#x2F;gopkgs&#x2F;cmd&#x2F;gopkgs gopkgs   github.com&#x2F;ramya-rao-a&#x2F;go-outline go-outline   github.com&#x2F;acroca&#x2F;go-symbols go-symbols   gola">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-09-01T07:50:33.000Z">
<meta property="article:modified_time" content="2020-09-02T08:49:46.199Z">
<meta property="article:author" content="Arthur Blitz">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/favicon-192x192.png" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
          
        
    
    <!-- title -->
    <title>VScode下的Go插件配置</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
<meta name="generator" content="Hexo 4.2.1"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects/">Projects</a></li>
         
          <li><a href="/typescript/">typescript</a></li>
         
          <li><a href="/flex-bison/">flex-bison</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2020/09/11/0x00-typescript-tutorial/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2020/08/05/hello-world/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&text=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&is_video=false&description=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=VScode下的Go插件配置&body=Check out this article: http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&name=VScode下的Go插件配置&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&t=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-必要资源说明"><span class="toc-number">1.</span> <span class="toc-text">1. 必要资源说明</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-脚本自动化实现"><span class="toc-number">2.</span> <span class="toc-text">2. 脚本自动化实现</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-代理实现（正解）下文引自格物"><span class="toc-number">3.</span> <span class="toc-text">3. 代理实现（正解）下文引自格物</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#GOPROXY-环境变量"><span class="toc-number">3.1.</span> <span class="toc-text">GOPROXY 环境变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参考资料"><span class="toc-number">3.2.</span> <span class="toc-text">参考资料</span></a></li></ol></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        VScode下的Go插件配置
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">传火之人</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2020-09-01T07:50:33.000Z" itemprop="datePublished">2020-09-01</time>
        
      
    </div>


      

      

    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <h2 id="1-必要资源说明"><a href="#1-必要资源说明" class="headerlink" title="1. 必要资源说明"></a>1. 必要资源说明</h2><table>
<thead>
<tr>
<th>插件地址</th>
<th>插件名称</th>
</tr>
</thead>
<tbody><tr>
<td>github.com/mdempsky/gocode</td>
<td>gocode</td>
</tr>
<tr>
<td>github.com/uudashr/gopkgs/cmd/gopkgs</td>
<td>gopkgs</td>
</tr>
<tr>
<td>github.com/ramya-rao-a/go-outline</td>
<td>go-outline</td>
</tr>
<tr>
<td>github.com/acroca/go-symbols</td>
<td>go-symbols</td>
</tr>
<tr>
<td>golang.org/x/tools/cmd/guru</td>
<td>guru</td>
</tr>
<tr>
<td>golang.org/x/tools/cmd/gorename</td>
<td>gorename</td>
</tr>
<tr>
<td>github.com/derekparker/delve/cmd/dlv</td>
<td>dlv</td>
</tr>
<tr>
<td>github.com/stamblerre/gocode</td>
<td>gocode-gomod</td>
</tr>
<tr>
<td>github.com/rogpeppe/godef</td>
<td>godef</td>
</tr>
<tr>
<td>github.com/ianthehat/godef</td>
<td>godef-gomod</td>
</tr>
<tr>
<td>github.com/sqs/goreturns</td>
<td>goreturns</td>
</tr>
<tr>
<td>golang.org/x/lint/golint</td>
<td>golint</td>
</tr>
</tbody></table>
<h2 id="2-脚本自动化实现"><a href="#2-脚本自动化实现" class="headerlink" title="2. 脚本自动化实现"></a>2. <del>脚本自动化实现</del></h2><ol>
<li><p><del><strong>思路说明</strong></del></p>
<ul>
<li><p><del>首先，我们将插件和他们的安装包名建立一个map。</del></p>
</li>
<li><p><del>其次，我们对这个map做一个遍历。</del></p>
</li>
<li><p><del>将买一个<code>MapEntry&lt;path,pluginName&gt;的key</code>（即path）做<code>split</code>操作，然后根据分片后的数组建立目录结构。</del></p>
</li>
<li><p><del>在每一个路径分片数组的末尾执行<code>git clone</code>操作</del></p>
</li>
<li><p><del>接着，在成功后进行跳回顶层目录（<code>$(GOPATH)</code>)。</del></p>
</li>
<li><p><del>此时，执行<code>go install pluginName</code></del></p>
</li>
<li><p><del>重复上面的过程直到遍历完毕，跟着再次跳回顶层目录（<code>$(GOPATH)</code>)。</del></p>
</li>
</ul>
</li>
<li><p><del><strong>实现脚本</strong>(<code>Python3</code>)</del></p>
<p> <del><figure class="highlight python"><figcaption><span>install_plugin.py</span><a href="/downloads/code/install_plugin.py">view raw</a></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/local/bin/python3</span></span><br><span class="line"><span class="comment"># -*- coding:utf-8 -*-  </span></span><br><span class="line"><span class="keyword">import</span> git</span><br><span class="line"><span class="keyword">import</span> os, subprocess</span><br><span class="line"><span class="keyword">import</span> shutil</span><br><span class="line"></span><br><span class="line">result = os.popen(<span class="string">"echo ~/go"</span>)</span><br><span class="line">res = result.read()</span><br><span class="line">go_path = res.splitlines()[<span class="number">0</span>]</span><br><span class="line">go_path_src = go_path + <span class="string">"/src"</span></span><br><span class="line">os.chdir(go_path_src)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 定义插件字典</span></span><br><span class="line">entries = {</span><br><span class="line">    <span class="string">"gocode"</span>:<span class="string">"github.com/mdempsky/gocode"</span>,</span><br><span class="line">    <span class="string">"gopkgs"</span>:<span class="string">"github.com/uudashr/gopkgs"</span>,</span><br><span class="line">    <span class="string">"go-outline"</span>:<span class="string">"github.com/ramya-rao-a/go-outline"</span>,</span><br><span class="line">    <span class="string">"go-symbols"</span>:<span class="string">"github.com/acroca/go-symbols"</span>,</span><br><span class="line">    <span class="string">"guru"</span>:<span class="string">"golang.org/x/tools/cmd/guru"</span>,</span><br><span class="line">    <span class="string">"gorename"</span>:<span class="string">"golang.org/x/tools/cmd/gorename"</span>,</span><br><span class="line">    <span class="string">"dlv"</span>:<span class="string">"github.com/derekparker/delve/cmd/dlv"</span>,</span><br><span class="line">    <span class="string">"gocode-gomod"</span>:<span class="string">"github.com/stamblerre/gocode"</span>,</span><br><span class="line">    <span class="string">"godef"</span>:<span class="string">"github.com/rogpeppe/godef"</span>,</span><br><span class="line">    <span class="string">"godef-gomod"</span>:<span class="string">"github.com/ianthehat/godef"</span>,</span><br><span class="line">    <span class="string">"goreturns"</span>:<span class="string">"github.com/sqs/goreturns"</span>,</span><br><span class="line">    <span class="string">"golint"</span>:<span class="string">"golang.org/x/lint/golint"</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> name,path <span class="keyword">in</span> entries.items():</span><br><span class="line">    <span class="comment"># 对路径进行分片</span></span><br><span class="line">    dirs = path.split(<span class="string">'/'</span>)</span><br><span class="line">    git_name = dirs[<span class="number">-1</span>]</span><br><span class="line">    dirs = dirs[<span class="number">0</span>:<span class="number">-1</span>]</span><br><span class="line">    root = go_path_src</span><br><span class="line">    os.chdir(root)</span><br><span class="line">    <span class="keyword">for</span> dir_name <span class="keyword">in</span> dirs:</span><br><span class="line">        dest = root+<span class="string">"/"</span>+dir_name</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> os.path.exists(dest):</span><br><span class="line">            os.mkdir(dir_name)</span><br><span class="line">            print(<span class="string">'mkdir '</span>+ dest)        </span><br><span class="line">        root = dest</span><br><span class="line">        print(<span class="string">"enter dir "</span>+ os.getcwd())</span><br><span class="line">        os.chdir(root)</span><br><span class="line">    </span><br><span class="line">    print(<span class="string">"current dir "</span>+ os.getcwd())</span><br><span class="line">    clone_path = os.getcwd()+git_name</span><br><span class="line">    <span class="keyword">if</span> os.path.exists(clone_path):</span><br><span class="line">        shutil.rmtree(clone_path)</span><br><span class="line"></span><br><span class="line">    print(<span class="string">"git clone "</span>+<span class="string">"https://"</span>+path+<span class="string">".git"</span>)</span><br><span class="line">    repo = git.Repo.clone_from(<span class="string">"https://"</span>+path+<span class="string">".git"</span>,git_name)</span><br></pre></td></tr></table></figure></del></p>
</li>
</ol>
<h2 id="3-代理实现（正解）下文引自格物"><a href="#3-代理实现（正解）下文引自格物" class="headerlink" title="3. 代理实现（正解）下文引自格物"></a>3. 代理实现（<code>正解</code>）下文引自<a href="https://shockerli.net/post/go-get-golang-org-x-solution/#goproxy-%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" target="_blank" rel="noopener"><code>格物</code></a></h2><h3 id="GOPROXY-环境变量"><a href="#GOPROXY-环境变量" class="headerlink" title="GOPROXY 环境变量"></a><strong><code>GOPROXY 环境变量</code></strong></h3><p>终于到了本文的终极大杀器 —— <code>GOPROXY。</code></p>
<p>我们知道从 <code>Go 1.11</code> 版本开始，官方支持了 <code>go module</code> 包依赖管理工具。</p>
<p>其实还新增了 <code>GOPROXY 环境变量</code>。如果设置了该变量，下载源代码时将会通过这个环境变量设置的代理地址，而不再是以前的直接从代码库下载。这无疑对我等无法科学上网的开发良民来说是最大的福音。</p>
<p>更可喜的是，<code>goproxy.io</code> 这个开源项目帮我们实现好了我们想要的。该项目允许开发者一键构建自己的 <code>GOPROXY</code> 代理服务。同时，也提供了公用的[代理服务] (<a href="https://goproxy.io)，我们只需设置该环境变量即可正常下载被墙的源码包了：">https://goproxy.io)，我们只需设置该环境变量即可正常下载被墙的源码包了：</a></p>
<p><code>export GOPROXY=https://goproxy.io</code></p>
<p>不过，需要依赖于 <code>go module</code> 功能。可通过 <code>export GO111MODULE=on</code> 开启 MODULE。</p>
<p>如果项目不在 <code>GOPATH</code> 中，则无法使用 <code>go get ...</code>，但可以使用 <code>go mod ...</code>相关命令。</p>
<p>也可以通过置空这个环境变量来关闭，<code>export GOPROXY=</code>。</p>
<p>对于 <code>Windows</code> 用户，可以在 <code>PowerShell</code> 中设置：</p>
<p><code>$env:GOPROXY = &quot;https://goproxy.io&quot;</code></p>
<p>最后，我们当然推荐使用 <code>GOPROXY</code> 这个环境变量的解决方式，前提是 <code>Go version &gt;= 1.11</code>。</p>
<p>最后的最后，七牛也出了个国内代理 goproxy.cn 方便国内用户更快的访问不能访问的包，真是良心。</p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><ul>
<li><a href="https://mp.weixin.qq.com/s/COethtOaiygsYev-kkCc4A" target="_blank" rel="noopener">goproxy.io for Go modules</a></li>
<li><a href="https://goproxy.io/" target="_blank" rel="noopener">goproxy.io</a></li>
<li><a href="https://goproxy.cn" target="_blank" rel="noopener">goproxy.cn</a></li>
<li><a href="https://shockerli.net/post/go-get-golang-org-x-solution/#goproxy-%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" target="_blank" rel="noopener">格物</a></li>
</ul>

  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects/">Projects</a></li>
         
          <li><a href="/typescript/">typescript</a></li>
         
          <li><a href="/flex-bison/">flex-bison</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-必要资源说明"><span class="toc-number">1.</span> <span class="toc-text">1. 必要资源说明</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-脚本自动化实现"><span class="toc-number">2.</span> <span class="toc-text">2. 脚本自动化实现</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-代理实现（正解）下文引自格物"><span class="toc-number">3.</span> <span class="toc-text">3. 代理实现（正解）下文引自格物</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#GOPROXY-环境变量"><span class="toc-number">3.1.</span> <span class="toc-text">GOPROXY 环境变量</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#参考资料"><span class="toc-number">3.2.</span> <span class="toc-text">参考资料</span></a></li></ol></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&text=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&is_video=false&description=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=VScode下的Go插件配置&body=Check out this article: http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&title=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&name=VScode下的Go插件配置&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://whtoo.github.io/2020/09/01/VScode%E4%B8%8B%E7%9A%84Go%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE/&t=VScode下的Go插件配置" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy;
    
    
    2016-2020
    Arthur Blitz
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects/">Projects</a></li>
         
          <li><a href="/typescript/">typescript</a></li>
         
          <li><a href="/flex-bison/">flex-bison</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


  <script src='https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.7.1/viz.js'></script>
  <script>
    String.prototype.replaceAll = function(search, replacement) {
      var target = this;
      return target.split(search).join(replacement);
    };

    let vizObjects = document.querySelectorAll('.graphviz')

    for (let item of vizObjects) {
      let svg = undefined
      try {
        svg = Viz(item.textContent.replaceAll('–', '--'), 'svg')
      } catch(e) {
        svg = `<pre class="error">${e}</pre>`
      }
      item.outerHTML = svg
    }
  </script>

</body>
</html>
